import { ManageSearchConfigAPI } from '@/pages/type';
import { AuthClientManageAPI } from '../common/type';

/** 认证客户端搜索字段信息 */
const getManageSearchColumns = (): AuthClientManageAPI.IHeaderSearchType => {
  return [
    {
      name: 'name',
      placeholder: '名称',
      label: '名称',
      componentType: 'Input',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'clientType',
      placeholder: '类型',
      label: '类型',
      componentType: 'Select',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
      dataSource: [
        {
          name: 'WEB应用',
          value: '0',
        },
        {
          name: '移动应用',
          value: '1',
        },
        {
          name: '三方应用',
          value: '2',
        },
      ],
    },
    {
      name: 'isOpen',
      placeholder: '状态',
      label: '状态',
      componentType: 'Select',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
      dataSource: [
        {
          name: '启动',
          value: '1',
        },
        {
          name: '禁用',
          value: '0',
        },
      ],
    },
    {
      name: 'remark',
      placeholder: '备注',
      label: '备注',
      componentType: 'Input',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
    },
  ];
};

const getSearchConfig: ManageSearchConfigAPI.IManageSearchConfig = [
  {
    fieldName: 'name',
    fieldType: 'String',
    fieldParam: 0,
    fieldUse: 0,
    isSearch: 0,
    searchType: 0,
    seq: 0,
  },
  {
    fieldName: 'clientType',
    fieldType: 'Integer',
    fieldParam: 0,
    fieldUse: 0,
    isSearch: 0,
    searchType: 1,
    seq: 0,
  },
  {
    fieldName: 'isOpen',
    fieldType: 'Integer',
    fieldParam: 0,
    fieldUse: 0,
    isSearch: 0,
    searchType: 1,
    seq: 0,
  },
  {
    fieldName: 'remark',
    fieldType: 'String',
    fieldParam: 0,
    fieldUse: 0,
    isSearch: 0,
    searchType: 0,
    seq: 0,
  },
];

export { getManageSearchColumns, getSearchConfig };
